var timeId1;
var timeId2;
//A里面的需要有convert,
AutoSave= function() {
	this.removeAll();
};
AutoSave.prototype={
timeId:[],
taskList:[],
timeInterval:30000,
addTask:function(A)
{
	var record=-1;
	if(A.name==null)
	{
		Ext.Msg.alert("提示","参数设置错误");
		return ;
	}
	for(var i=0;i<this.taskList.length;i++)
	{
		if(this.taskList[i]==A.name)
		{
			record=i;
			break;
		}
	}
	if(record>-1)
		return;
	var newId=this.timeId.length;
	newId=window.setInterval(A.action, this.timeInterval)
	this.timeId.push(newId);
	this.taskList.push(A.name);
	
},
removeAll:function()
{
	for(var i=0;i<this.timeId.length;i++)
	{
		this.remove(this.timeId[i]);
	}
},
remove:function(A)
{
	var id=A;
	window.clearInterval(A);
	this.timeId.remove(A);
	this.taskList.remove(this.taskList.indexOf(A));
},
findTask:function(A)
{
	if(A==null)
		return this.taskList;
	else
		return this.taskList[A];
}
};

